package com.wangwg.bigdata.model;

import org.apache.hadoop.hbase.HBaseConfiguration;
import org.geotools.data.DataStore;
import org.geotools.data.DataStoreFinder;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class ShpFileToHbaseConvertor {

    public ShpFileToHbaseConvertor() {


    }

    public void convert() throws IOException {
    /*    Connection connection = null;
        Configuration conf = HBaseConfiguration.create();
        String ip = "192.168.150.132";
        String port = "2181";
        conf.set("hbase.zookeeper.quorum", ip + ":" + port);
        //conf.set("hbase.zookeeper.quorum", "zyb1:2181,zyb2:2181,zyb9:2181");
        conf.setInt("zookeeper.recovery.retry", 0);
        conf.setInt("zookeeper.session.timeout", 30000);
        connection = ConnectionFactory.createConnection(conf);*/

        Map<String, String> params = new HashMap<>();
        params.put("hbase.zookeepers", "geomesa1.com:2181,geomesa2.com:2181,geomesa3.com:2181");
        params.put("hbase.catalog", "Test");
        DataStore datastore = DataStoreFinder.getDataStore(params);
        if (datastore != null) {
            String[] typeNames = datastore.getTypeNames();
        }
    }
}
